package com.example.news123.ui;

import android.content.Context;
import android.media.MediaPlayer;
import android.util.AttributeSet;
import android.view.KeyEvent;
import android.widget.VideoView;import android.content.Context;
import android.util.AttributeSet;
import android.widget.VideoView;

public class CustomVideoView extends VideoView {


    public CustomVideoView(Context context) {
        super(context);
    }

    public CustomVideoView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public CustomVideoView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    public CustomVideoView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        super(context, attrs, defStyleAttr, defStyleRes);
    }

    @Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {

        class MyVideoView extends VideoView {
            public MyVideoView(Context context, AttributeSet attrs, int defStyle) {
                super(context, attrs, defStyle);
            }

            public MyVideoView(Context context, AttributeSet attrs) {
                super(context, attrs);
            }

            public MyVideoView(Context context) {
                super(context);
            }

            @Override
            protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
// TODO Auto-generated method stub
                int width = getDefaultSize(0, widthMeasureSpec);
                int height = getDefaultSize(0, heightMeasureSpec);
                setMeasuredDimension(width, height);
            }
        }

    }
}
